set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/3rdParty )
find_package(openssl REQUIRED)
find_package(crypto REQUIRED)

# Includes
include_directories( ./include )
include_directories( ./src )
include_directories( ${PROJECT_SOURCE_DIR}/PopupLibOSAL/include )
include_directories( ${openssl_INCLUDE_DIRS} )

# Files
file( GLOB sources ./src/*.[hc]pp ./src/msg/*.[hc]pp)

# Static lib
add_library( popup-static STATIC ${sources} )
target_link_libraries( popup-static osal-static ${openssl_LIBRARY} )
add_dependencies( popup-static 3rdParty )

# Shared lib
#add_library( popup SHARED ${sources} )
#target_link_libraries( popup osal ${openssl_LIBRARY} ${crypto_LIBRARY})
#add_dependencies( popup 3rdParty )

# Windows specific
if (${CMAKE_SYSTEM_NAME} STREQUAL Windows)
  find_package(pthread REQUIRED)
  include_directories( ${pthread_INCLUDE_DIRS} )
  #target_link_libraries( popup osal ${pthread_LIBRARY})
endif (${CMAKE_SYSTEM_NAME} STREQUAL Windows)

# Installation
#install( TARGETS popup DESTINATION ${POPUP_INSTALL_DIR}/lib )
